package com.spring.core.io;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;

/**
 * @file UrlResource
 * @brief UrlResource
 * @details UrlResource
 * @version 1.0
 * @author liyuncong
 * @date 2023-01-13
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                        NAME               DESCRIPTION
 * 2023-01-13                  liyuncong          Created
 *
 */
public class UrlResource extends AbstractFileResolvingResource{

    private final URI uri;

    private final URL url;

    private volatile URL cleanedUrl;

    public UrlResource(URL url) {
        // TODO Assert
        this.uri = null;
        this.url = url;
    }

    public UrlResource(URI uri) throws MalformedURLException {
        this.uri = uri;
        this.url = uri.toURL();
    }

    @Override
    public InputStream getInputStream() throws IOException {
        return null;
    }

    @Override
    public String getFileName() {
        return null;
    }
}
